/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Persistencia;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author BATAQUERO
 */
@Entity
@Table(name = "supervisor", catalog = "Sp2_DB", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Supervisor.findAll", query = "SELECT s FROM Supervisor s"),
    @NamedQuery(name = "Supervisor.findByIdSupervisor", query = "SELECT s FROM Supervisor s WHERE s.idSupervisor = :idSupervisor"),
    @NamedQuery(name = "Supervisor.findByCedulasupervisor", query = "SELECT s FROM Supervisor s WHERE s.cedulasupervisor = :cedulasupervisor"),
    @NamedQuery(name = "Supervisor.findByNombressupervisor", query = "SELECT s FROM Supervisor s WHERE s.nombressupervisor = :nombressupervisor"),
    @NamedQuery(name = "Supervisor.findByApellido1Supervisor", query = "SELECT s FROM Supervisor s WHERE s.apellido1Supervisor = :apellido1Supervisor"),
    @NamedQuery(name = "Supervisor.findByApellido2Supervisor", query = "SELECT s FROM Supervisor s WHERE s.apellido2Supervisor = :apellido2Supervisor"),
    @NamedQuery(name = "Supervisor.findByCorreoSupervisor", query = "SELECT s FROM Supervisor s WHERE s.correoSupervisor = :correoSupervisor"),
    @NamedQuery(name = "Supervisor.findByTelefonosupervisor", query = "SELECT s FROM Supervisor s WHERE s.telefonosupervisor = :telefonosupervisor"),
    @NamedQuery(name = "Supervisor.findByCelularsupervisor", query = "SELECT s FROM Supervisor s WHERE s.celularsupervisor = :celularsupervisor"),
    @NamedQuery(name = "Supervisor.findByDireccionsupervisor", query = "SELECT s FROM Supervisor s WHERE s.direccionsupervisor = :direccionsupervisor"),
    @NamedQuery(name = "Supervisor.findByCargoSupervisor", query = "SELECT s FROM Supervisor s WHERE s.cargoSupervisor = :cargoSupervisor"),
    @NamedQuery(name = "Supervisor.findByProfesionsupervisor", query = "SELECT s FROM Supervisor s WHERE s.profesionsupervisor = :profesionsupervisor"),
    @NamedQuery(name = "Supervisor.findByActivadosupervisor", query = "SELECT s FROM Supervisor s WHERE s.activadosupervisor = :activadosupervisor")})
public class Supervisor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_supervisor")
    private Integer idSupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 12)
    @Column(name = "Cedula_supervisor")
    private String cedulasupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "Nombres_supervisor")
    private String nombressupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "apellido1_supervisor")
    private String apellido1Supervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "apellido2_supervisor")
    private String apellido2Supervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "correo_supervisor")
    private String correoSupervisor;
    @Size(max = 45)
    @Column(name = "Telefono_supervisor")
    private String telefonosupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 12)
    @Column(name = "Celular_supervisor")
    private String celularsupervisor;
    @Size(max = 60)
    @Column(name = "Direccion_supervisor")
    private String direccionsupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 80)
    @Column(name = "cargo_supervisor")
    private String cargoSupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "Profesion_supervisor")
    private String profesionsupervisor;
    @Column(name = "Activado_supervisor")
    private Boolean activadosupervisor;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "supervisor")
    private List<ResumenSemPracProf> resumenSemPracProfList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idSupervisor")
    private List<Estudiante> estudianteList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "supervisor")
    private List<SeguimientoInformeMesual> seguimientoInformeMesualList;
    @JoinColumn(name = "id_supervisor", referencedColumnName = "id_usuario", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Usuario usuario;
    @JoinColumn(name = "id_coodinador_practicas", referencedColumnName = "id_coodinador_practicas")
    @ManyToOne(optional = false)
    private CoordinadorPracticas idCoodinadorPracticas;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "supervisor")
    private List<EvaluacionFinalLogros> evaluacionFinalLogrosList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "supervisor")
    private List<SeguimientoTelefonicoPractica> seguimientoTelefonicoPracticaList;

    public Supervisor() {
    }

    public Supervisor(Integer idSupervisor) {
        this.idSupervisor = idSupervisor;
    }

    public Supervisor(Integer idSupervisor, String cedulasupervisor, String nombressupervisor, String apellido1Supervisor, String apellido2Supervisor, String correoSupervisor, String celularsupervisor, String cargoSupervisor, String profesionsupervisor) {
        this.idSupervisor = idSupervisor;
        this.cedulasupervisor = cedulasupervisor;
        this.nombressupervisor = nombressupervisor;
        this.apellido1Supervisor = apellido1Supervisor;
        this.apellido2Supervisor = apellido2Supervisor;
        this.correoSupervisor = correoSupervisor;
        this.celularsupervisor = celularsupervisor;
        this.cargoSupervisor = cargoSupervisor;
        this.profesionsupervisor = profesionsupervisor;
    }

    public Integer getIdSupervisor() {
        return idSupervisor;
    }

    public void setIdSupervisor(Integer idSupervisor) {
        this.idSupervisor = idSupervisor;
    }

    public String getCedulasupervisor() {
        return cedulasupervisor;
    }

    public void setCedulasupervisor(String cedulasupervisor) {
        this.cedulasupervisor = cedulasupervisor;
    }

    public String getNombressupervisor() {
        return nombressupervisor;
    }

    public void setNombressupervisor(String nombressupervisor) {
        this.nombressupervisor = nombressupervisor;
    }

    public String getApellido1Supervisor() {
        return apellido1Supervisor;
    }

    public void setApellido1Supervisor(String apellido1Supervisor) {
        this.apellido1Supervisor = apellido1Supervisor;
    }

    public String getApellido2Supervisor() {
        return apellido2Supervisor;
    }

    public void setApellido2Supervisor(String apellido2Supervisor) {
        this.apellido2Supervisor = apellido2Supervisor;
    }

    public String getCorreoSupervisor() {
        return correoSupervisor;
    }

    public void setCorreoSupervisor(String correoSupervisor) {
        this.correoSupervisor = correoSupervisor;
    }

    public String getTelefonosupervisor() {
        return telefonosupervisor;
    }

    public void setTelefonosupervisor(String telefonosupervisor) {
        this.telefonosupervisor = telefonosupervisor;
    }

    public String getCelularsupervisor() {
        return celularsupervisor;
    }

    public void setCelularsupervisor(String celularsupervisor) {
        this.celularsupervisor = celularsupervisor;
    }

    public String getDireccionsupervisor() {
        return direccionsupervisor;
    }

    public void setDireccionsupervisor(String direccionsupervisor) {
        this.direccionsupervisor = direccionsupervisor;
    }

    public String getCargoSupervisor() {
        return cargoSupervisor;
    }

    public void setCargoSupervisor(String cargoSupervisor) {
        this.cargoSupervisor = cargoSupervisor;
    }

    public String getProfesionsupervisor() {
        return profesionsupervisor;
    }

    public void setProfesionsupervisor(String profesionsupervisor) {
        this.profesionsupervisor = profesionsupervisor;
    }

    public Boolean getActivadosupervisor() {
        return activadosupervisor;
    }

    public void setActivadosupervisor(Boolean activadosupervisor) {
        this.activadosupervisor = activadosupervisor;
    }

    @XmlTransient
    public List<ResumenSemPracProf> getResumenSemPracProfList() {
        return resumenSemPracProfList;
    }

    public void setResumenSemPracProfList(List<ResumenSemPracProf> resumenSemPracProfList) {
        this.resumenSemPracProfList = resumenSemPracProfList;
    }

    @XmlTransient
    public List<Estudiante> getEstudianteList() {
        return estudianteList;
    }

    public void setEstudianteList(List<Estudiante> estudianteList) {
        this.estudianteList = estudianteList;
    }

    @XmlTransient
    public List<SeguimientoInformeMesual> getSeguimientoInformeMesualList() {
        return seguimientoInformeMesualList;
    }

    public void setSeguimientoInformeMesualList(List<SeguimientoInformeMesual> seguimientoInformeMesualList) {
        this.seguimientoInformeMesualList = seguimientoInformeMesualList;
    }

    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }

    public CoordinadorPracticas getIdCoodinadorPracticas() {
        return idCoodinadorPracticas;
    }

    public void setIdCoodinadorPracticas(CoordinadorPracticas idCoodinadorPracticas) {
        this.idCoodinadorPracticas = idCoodinadorPracticas;
    }

    @XmlTransient
    public List<EvaluacionFinalLogros> getEvaluacionFinalLogrosList() {
        return evaluacionFinalLogrosList;
    }

    public void setEvaluacionFinalLogrosList(List<EvaluacionFinalLogros> evaluacionFinalLogrosList) {
        this.evaluacionFinalLogrosList = evaluacionFinalLogrosList;
    }

    @XmlTransient
    public List<SeguimientoTelefonicoPractica> getSeguimientoTelefonicoPracticaList() {
        return seguimientoTelefonicoPracticaList;
    }

    public void setSeguimientoTelefonicoPracticaList(List<SeguimientoTelefonicoPractica> seguimientoTelefonicoPracticaList) {
        this.seguimientoTelefonicoPracticaList = seguimientoTelefonicoPracticaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSupervisor != null ? idSupervisor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Supervisor)) {
            return false;
        }
        Supervisor other = (Supervisor) object;
        if ((this.idSupervisor == null && other.idSupervisor != null) || (this.idSupervisor != null && !this.idSupervisor.equals(other.idSupervisor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Persistencia.Supervisor[ idSupervisor=" + idSupervisor + " ]";
    }
    
}
